home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / vg-2.03 / video / v86types.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  1.0 KB  |  38 lines

  1. /*
  2.  * Copyright (C) 1990-1992 Michael Davidson.
  3.  * All rights reserved.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software
  6.  * and its documentation for any purpose and without fee is hereby
  7.  * granted, provided that the above copyright notice appear in all
  8.  * copies and that both that copyright notice and this permission
  9.  * notice appear in supporting documentation.
  10.  *
  11.  * This software is provided "as is" without express or implied warranty.
  12.  */
  13.  
  14. #ifndef    V86TYPES_H
  15. #define    V86TYPES_H
  16.  
  17. /*
  18.  * typedefs for V86 mode data
  19.  */
  20. typedef unsigned char    byte_t;        /*  8 bit byte            */
  21. typedef unsigned short    word_t;        /* 16 bit word            */
  22. typedef unsigned long    dword_t;    /* 32 bit double word        */
  23. typedef unsigned long    fptr_t;        /* 32 bit real-mode far pointer    */
  24.  
  25. /*
  26.  * macros for accessing byte and word data
  27.  */
  28. #define    BYTE(n, v)    (((byte_t *)(&v))[n])
  29. #define    WORD(n, v)    (((word_t *)(&v))[n])
  30.  
  31. /*
  32.  * macros for accessing segment and offset of a far pointer
  33.  */
  34. #define    SEGMENT(f)    WORD(1, f)
  35. #define    OFFSET(f)    WORD(0, f)
  36.  
  37. #endif    /* V86TYPES_H */
  38.